﻿namespace K9Nano.Updater.Server;

public interface IReleaseManager
{
    ValueTask<AvailableVersion?> GetLatestVersionAsync(CancellationToken cancellation = default);
    ValueTask<ReleaseMetadata?> GetMetadataAsync(Version version, CancellationToken cancellation = default);
    ValueTask<ReleaseFile?> GetReleaseFileAsync(Version version, string fileUri, CancellationToken cancellation = default);
    ValueTask<IEnumerable<ReleaseInfo>> GetAllReleasesAsync(string clientId, CancellationToken cancellation = default);
    ValueTask<string> GetReleaseLogFileAsync(string clientId, Version version, CancellationToken cancellation = default);
    ValueTask SaveAsync(string clientId, Version version, Stream zipStream, CancellationToken cancellation = default);
    ValueTask<bool> ExistsAsync(string clientId, Version version, CancellationToken cancellation = default);
}